<?php
/**
 * Created by PhpStorm.
 * User: zhangrxiang
 * Date: 2017/6/29
 * Time: 21:23
 */

$zip = new ZipArchive();

$zip->open("test.zip");
for( $i = 0; $i < $zip->numFiles; $i++ ){
	$stat = $zip->statIndex( $i );
	print_r( basename( $stat['name'] ) . PHP_EOL );
}

//
//echo $zip->getFromName("2.php");

echo $zip->filename.PHP_EOL;
echo $zip->numFiles.PHP_EOL;
echo $zip->statusSys.PHP_EOL;
echo $zip->comment.PHP_EOL;
$stream = $zip->getStream( "2.php" );
//echo fread($stream,1024);

//$zip->extractTo(__DIR__);